VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "comdlg32.ocx"
Begin VB.Form FrmHerramienta 
   Caption         =   "Form1"
   ClientHeight    =   3195
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4680
   LinkTopic       =   "Form1"
   ScaleHeight     =   3195
   ScaleWidth      =   4680
   StartUpPosition =   3  'Windows Default
   Begin VB.CommandButton Command3 
      Caption         =   "Asignar Categorias"
      Height          =   495
      Left            =   720
      TabIndex        =   2
      Top             =   2400
      Width           =   2895
   End
   Begin MSComDlg.CommonDialog cd1 
      Left            =   2520
      Top             =   2640
      _ExtentX        =   847
      _ExtentY        =   847
      _Version        =   393216
      DialogTitle     =   "Selecciones base de datos dacli3"
      FileName        =   "dacli.mdb"
      Filter          =   "  |*.mdb"
      InitDir         =   "c:\dacli3"
   End
   Begin VB.CommandButton Command2 
      Caption         =   "Importar"
      Enabled         =   0   'False
      Height          =   495
      Left            =   720
      TabIndex        =   1
      Top             =   1800
      Width           =   2895
   End
   Begin VB.CommandButton Command1 
      Caption         =   "Seleccione Bd de Dacli3"
      Height          =   495
      Left            =   720
      TabIndex        =   0
      Top             =   600
      Width           =   2895
   End
End
Attribute VB_Name = "FrmHerramienta"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim bd3 As DAO.Database
Private Sub Command1_Click()
    cd1.ShowOpen
    Set bd3 = OpenDatabase(cd1.FileName)
    Command2.Enabled = True
    MsgBox "Base de datos seleccionada"
    
    
    
End Sub
Sub Agregar(Exa, valor)
    On Error Resume Next
    n = AutoNumero("cod_examen", "examenes")
    Dim t As DAO.Recordset
    x = Exa
    Set t = Base.OpenRecordset("select *from examenes where descripcion='" & Exa & "'")
    If t.EOF Then
        Base.Execute "insert into examenes(cod_examen,descripcion) values(" & n & ",'" & Exa & "')"
    Else
        n = t(0)
    End If
    If valor <> "" Then
        Base.Execute "insert into valores(cod_examen,valor) values(" & n & ",'" & valor & "')"
    End If
    
End Sub
Private Sub Command2_Click()
    Dim t As DAO.Recordset
    Base.Execute "delete from valores"
    Set t = bd3.OpenRecordset("select *from UNIONVALORES")
    While Not t.EOF
        On Error Resume Next
        Agregar t(1), t(2)
        Agregar t(1), t(3)
        Agregar t(1), t(4)
        Agregar t(1), t(5)
        Agregar t(1), t(6)
        Agregar t(1), t(7)
        Agregar t(1), t(8)
        Agregar t(1), t(9)
        Agregar t(1), t(10)
        Agregar t(1), t(11)
        Agregar t(1), t(12)
        Agregar t(1), t(13)
        Agregar t(1), t(14)
        Agregar t(1), t(15)
        Agregar t(1), t(16)
        Agregar t(1), t(17)
        Agregar t(1), t(18)
        Agregar t(1), t(19)
        Agregar t(1), t(20)
        Agregar t(1), t(21)
        Agregar t(1), t(22)
        Agregar t(1), t(23)
        Agregar t(1), t(24)
        Agregar t(1), t(25)
        Agregar t(1), t(26)
        Agregar t(1), t(27)
        Agregar t(1), t(28)
        Agregar t(1), t(29)
        Agregar t(1), t(30)
        Agregar t(1), t(31)
        Agregar t(1), t(32)
        
        
        t.MoveNext
    Wend
    MsgBox "Importados"
    
End Sub

Private Sub Command3_Click()
    frmAsigCategorias.Show vbModal
End Sub
